/*
 *  Copyright (C) 2010 Interactive Media Management
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package dk.i2m.converge.domain.search;

import java.util.Calendar;

/**
 * A single result from the search engine.
 *
 * @author Allan Lykke Christensen
 */
public class SearchResult {

    /** Unique identifier of the hit. */
    private Long id = 0L;

    /** Date of the hit. */
    private Calendar date = null;

    private String title = "";

    private String description = "";

    private String note = "";

    private String link = "";

    private String type = "";

    private String repository = "";

    private String tags = "";

    private String people = "";

    private boolean preview = false;

    private String previewLink = "";

    public SearchResult() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Calendar getDate() {
        return date;
    }

    public void setDate(Calendar date) {
        this.date = date;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getRepository() {
        return repository;
    }

    public void setRepository(String repository) {
        this.repository = repository;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getPeople() {
        return people;
    }

    public void setPeople(String people) {
        this.people = people;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    /**
     * Gets a note of the search result. The note contains information
     * about which outlet and section the item was published.
     *
     * @return Note of the search result
     */
    public String getNote() {
        return note;
    }

    /**
     * Sets a note for the search result.
     *
     * @param note
     *          Note of the search result
     */
    public void setNote(String note) {
        this.note = note;
    }

    /**
     * Determines if there is a graphical preview of the result (such as an
     * image).
     *
     * @return {@code true} if there is an image preview, otherwise {@code false}
     */
    public boolean isPreview() {
        return preview;
    }

    /**
     * Sets the preview availability indicator.
     *
     * @param preview
     *          {@code true} if there is an image preview, otherwise
     *          {@code false}
     */
    public void setPreview(boolean preview) {
        this.preview = preview;
    }

    /**
     * Gets the link to the preview.
     *
     * @return Hyperlink to the preview
     */
    public String getPreviewLink() {
        return previewLink;
    }

    /**
     * Sets the hyperlink to the preview.
     *
     * @param previewLink
     *          Hyperlink to the preview
     */
    public void setPreviewLink(String previewLink) {
        this.previewLink = previewLink;
    }
}
